#if !defined(PARSE_MINI_VCF_H)
#define PARSE_MINI_VCF_H

#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/spirit/include/classic_position_iterator.hpp>
#include <boost/spirit/include/support_multi_pass.hpp>
#include <boost/spirit/include/support_look_ahead.hpp>
//#include "lines_buffer.h"
//#include "tbb/cache_aligned_allocator.h"
    // tbb::cache_aligned_allocator



struct t_strain_data
{
    char genotype1;
    char genotype2;
    int  mapping_quality;
    int  high_quality_genotype; // only valid for ALTs, == -1 for Wildtype REF-REF 
    int  genotype_quality;
    int  depth;
};

struct t_mini_vcf
{
    std::string                 chromosome;
    unsigned                    pos;
    //std::string               identifier;
    std::string                 ref;
    std::string                 alt;
    //std::string               quality;
    //std::string               filter;
    //std::string               info;
    //std::string               format;
    std::vector<t_strain_data>  strain_data;  
};

template <typename Iterator>
struct mini_vcf_grammar;
typedef std::vector<char> 													t_storage; 

typedef boost::shared_ptr<mini_vcf_grammar<std::string::const_iterator> > sp_vcf_grammar ;
typedef boost::shared_ptr<mini_vcf_grammar<t_storage::const_iterator> > sp_vcf_vecchar_grammar ;

sp_vcf_vecchar_grammar	create_mini_vcf_vecchar_grammar	(unsigned cnt_strains, unsigned& curr_line_number);
sp_vcf_grammar 			create_mini_vcf_grammar			(unsigned cnt_strains, unsigned& curr_line_number);


bool parse_mini_vcf(sp_vcf_grammar p_vcf_grammar, std::string::const_iterator& beg, std::string::const_iterator end, t_mini_vcf& res);
bool parse_mini_vcf(sp_vcf_vecchar_grammar p_vcf_grammar, t_storage::const_iterator& beg, t_storage::const_iterator end, t_mini_vcf& res);


#endif	// PARSE_MINI_VCF_H
